package com.mldong.auth.data;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.mldong.annotation.DictEnum;
import com.mldong.base.CodedEnum;

@DictEnum(key="sys_role_data_scope",name="角色数据范围")
public enum RoleDataScopeEnum implements CodedEnum {
    ALL_DATA(1, "全部数据权限"),
    CUSTOM_DATA(2, "自定义数据权限"),
    DEPT_DATA(3, "本部门数据权限"),
    DEPT_AND_SUB_DATA(4, "本部门及以下部门权限"),
    SELF_DATA(5, "仅本人数据权限")

    ;
    private Integer code;
    private String message;
    @JsonCreator
    public static RoleDataScopeEnum forValue(Object value) {
        return CodedEnum.codeOf(RoleDataScopeEnum.class, value).get();
    }
    RoleDataScopeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    @JsonValue
    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
